﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>管理员登录</title>
    @*@Styles.Render("~/contenst/css/pintuer", "~/content/css/admin", "~/content/css/layer")*@

    <link href="~/Areas/Admin/Content/libs/pintuer/css/pintuer.css" rel="stylesheet" />
    <link href="~/Areas/Admin/content/css/admin.css" rel="stylesheet" />
    <link href="~/Areas/Admin/Content/libs/layer/skin/layer.css" rel="stylesheet" />
    <link href="~/Areas/Admin/Content/libs/layer/skin/layer.ext.css" rel="stylesheet" />
    <script>
        @functions{
            static string TokenHeaderValue()
            {
                string cookieToken, formToken;
                AntiForgery.GetTokens(null, out cookieToken, out formToken);
                return cookieToken + ":" + formToken;
            }
        }
        var requestVerificationToken = '@TokenHeaderValue()';

    </script>
</head>

<body>
    <div class="container">
        <div class="line">
            <div class="xs6 xm4 xs3-move xm4-move">
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                @using (Html.BeginForm("Login", "Account", FormMethod.Post, new
                {
                    @class = "m-t",
                    @id = "form"
                }))
                {
                    @Html.AntiForgeryToken()
                    <div class="panel">
                        <div class="panel-head"><strong>桂乡田源后台管理系统</strong></div>
                        <div class="panel-body" style="padding:30px;">
                            <div class="form-group">
                                <div class="field field-icon-right">
                                    <input type="text" class="input" name="userName" placeholder="登录账号" data-validate="required:请填写账号" />
                                    <span class="icon icon-user"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="field field-icon-right">
                                    <input type="password" class="input" name="password" placeholder="密码" data-validate="required:请填写密码" onkeypress = "if(event.keyCode==13) {submitForm();return false;}" />
                                    <span class="icon icon-key"></span>
                                </div>
                            </div>
                        </div>
                        <div class="panel-foot text-center">
                            <button class="button button-block bg-main text-big" type="button" onclick="submitForm()">立即登录后台</button>
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
    @*@Scripts.Render("~/content/js/jquery", "~/content/js/jq-form", "~/content/js/pintuer", "~/content/js/layer")*@
    <script type="text/javascript" src="~/Areas/Admin/Content/libs/jquery/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="~/Areas/Admin/Content/libs/jquery/jquery.form.js"></script>
    <script type="text/javascript" src="~/Areas/Admin/Content/libs/com.js"></script>
    <script type="text/javascript" src="~/Areas/Admin/content/libs/pintuer/js/pintuer.js"></script>
    <script type="text/javascript" src="~/Areas/Admin/Content/libs/layer/layer.js"></script>
    <script type="text/javascript" src="~/Areas/Admin/Content/libs/layer/extend/layer.ext.js"></script>
    <script type="text/javascript">
        function submitForm() {

            com.submitForm({
                isValid: true,
                $form: $("#form"),
                headers: { "RequestVerificationToken": requestVerificationToken },
                success: function (result) {
                    if (result.success) {
                            location.href = '@Url.Action("Index","Home")';
                    } else {
                        layer.alert(result.errorMsg);
                    }
                }
            });


        }
    </script>
</body>

</html>
